<?php

class Yo
{
    public static function create_echo($id = false)
    {
        Tool::echo(self::ini(10001), 200, ['id' => $id]);
    }

    public static function delete_echo($id = false)
    {
        Tool::echo(self::ini(10002), 200, ['id' => $id]);
    }

    public static function update_echo($id = false)
    {
        Tool::echo(self::ini(10003), 200, ['id' => $id]);
    }

    public static function echo($data = [])
    {
        Tool::echo(self::ini(10004), 200, $data);
    }

    // region 读取 success ini
    public static function ini($key, $default = '操作成功')
    {
        if (!$key) return $default;
        $path = dirname(__DIR__) . '/success.ini';
        $config_file_path = $path;
        $config_info = parse_ini_file($config_file_path);
        return (isset($config_info['SUCCESS_' . $key])) ? $config_info['SUCCESS_' . $key] : $default;
    }
    // endregion
}